package com.dd.stack.file.config.metrics;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author liuxianmeng
 * @CreateTime 2024/9/20 23:11
 * @Description 指标注册配置
 */
@Configuration
public class MetricsRegisterConfig {
    @Bean
    protected MeterRegistryCustomizer<MeterRegistry> configure(@Value("${spring.application.name}") String appName) {
        return (registry) -> registry.config().commonTags("application", appName);
    }
}
